using DomainModel.Ninject;
using EsbMonitor.Ninject;
using Ninject;
using NServiceBus;

namespace EsbMonitor
{
    public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
    {
        public void Init()
        {
            if (KernelContainer.Kernel == null)
            {
                KernelContainer.Kernel = new StandardKernel();

                KernelContainer.Kernel.Load(typeof(DataLayerNinjectModule).Assembly);
            }

            NServiceBus.SetLoggingLibrary.Log4Net(log4net.Config.XmlConfigurator.Configure);
            Configure.With().DefaultBuilder().XmlSerializer().UnicastBus().MsmqTransport().IsTransactional(true);
        }
    }
}